/**
 * Created by IntelliJ IDEA.
 * User: ryan
 * Date: Sep 16, 2010
 * Time: 5:48:35 PM
 * To change this template use File | Settings | File Templates.
 */
$(function() {
	module('meetingMinutes');

	test("Init Conditions", 2, function() {
        ok($('#minutes'), 'Div exits to test');
        ok(meeting, 'js object exists');
    });

    test("Create inital form", 3, function() {
        var div = $('#minutes');

        meeting.ui.newMeeting('#minutes');

        equals(div.find('form').attr('id'), 'currentForm', 'Form');
        equals($('#currentForm').css('margin-left'), '0px', 'No margin left on root entry');

        equals(div.find('.rootCreateSubtopic').size(), 1, 'Root subtopic addition');

        fixImageReferences();

        // should test for blur.
        var img = $('.rootCreateSubtopic img');
        img.attr('src');
        img.mouseover();
        img.attr('src');
        img.mouseout();
        img.attr('src');
    });

    test("Meeting with existing State", 1, function() {

        meeting.ui.existingMeeting('#minutes', minutes);
    });



    function fixImageReferences() {
         $('#minutes img').each(function() {
             var src = $(this).attr('src');
             src = '../' + src;
            $(this).attr('src', src);
        });
    }


})